package com.xq.jedis.sboot;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.CountDownLatch;

/**
 * 功能说明:接收器:接收消息的类.
 * <p>创建时间: 2018-10-20 05:48</p>
 *
 * @author 郭凯强
 * @version 1.0-SNAPSHOT
 */
public class Receiver {
    private final Logger logger = LoggerFactory.getLogger(Receiver.class);
    private CountDownLatch latch;

    public Receiver(CountDownLatch latch){
        this.latch=latch;
    }

    public void receiveMessage(String message){
        logger.info("Received<{}>",message);
        latch.countDown();
    }
}
